package com;

import java.util.*;

public class Demo {
    public static void main(String[] args) {
//        Person p1 = new Person(20,"11");
//        Person p2 = new Person(21,"11");
//        Person p3 = new Person(19,"11");
//
//        //按照年龄大小升序排列
//        Set<Person> set = new TreeSet<>(new MyCompare());
//        set.add(p1);
//        set.add(p2);
//        set.add(p3);
//        System.out.println(set);

//啊啊

        //kmjpej1`pojpomd09i-kf4a35416ac.,./cmkaljfklnmrkl2jkm13lk1ndma c1

        //求上边每个字符出现的次数
        //k: 8  m:1
        Map<Character,Integer> map= new HashMap<>();
        String s = "kmjpej1`pojpomd09i-kf4a35416ac.,./cmkaljfklnmrkl2jkm13lk1ndma c1";
        char[] chars = s.toCharArray();
        for(Character c: chars){
            Integer integer = map.get(c);
            if(integer == null){
                map.put(c,1);
            }else {
                map.put(c,integer+1);
            }
        }
        Set<Character> keySet = map.keySet();
        for(Character c: keySet){
            System.out.println(c+":"+map.get(c));
        }


    }
}
